package org.common.utils.fasttest;

import org.apache.commons.io.FileUtils;
import java.io.File;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.util.List;

/**
 * @author zhouzhibing
 * @date 2024/4/1
 */
public class TestFile {
    public static void test() {

        File file =  FileUtils.getFile("E:\\Workspaces\\GameAle\\crush\\crush_server\\game\\src\\main\\resources\\data\\Items.json");
        Test.doHandler("FileUtils.readLines" , 10000 , 10 , (index) -> {
            try {
                List<String> lineList = FileUtils.readLines(file , StandardCharsets.UTF_8);
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        });

//        Test.doHandler("FileUtils.readFileToString" , 10000 , 10 , () -> {
//            try {
//                String content  = FileUtils.readFileToString(file , StandardCharsets.UTF_8);
//            } catch (IOException e) {
//                throw new RuntimeException(e);
//            }
//        });
    }
}
